package xmlParser;

import java.util.ArrayList;

import ecologylab.xml.ElementState;
import ecologylab.xml.xml_inherit;
import ecologylab.xml.ElementState.xml_collection;
import ecologylab.xml.types.element.ArrayListState;

@xml_inherit
public class Table extends ElementState
{
	@xml_nested @xml_tag("fieldTypes") TableType tableType = new TableType();
	@xml_collection("record") ArrayList<Record> records = new ArrayList<Record>();
	
	public Table()
	{
	}
	
	public void addRecord(Record record)
	{
		records.add(record);
	}
	
	public void addfieldType(ColFieldType colFieldType)
	{
		tableType.addfieldType(colFieldType);
	}

	public String getFieldTypeString(String name)
	{
		return tableType.getFieldTypeString(name);
	}
	
	public Integer getFieldTypeInt(String name)
	{
		return tableType.getFieldTypeInt(name);
	}
	
	public ArrayList<Record> getRecords() {
		return records;
	}

	public void setRecords(ArrayList<Record> records) {
		this.records = records;
	}
	
	
}
